<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app">
        <button @click="inputVal='你好'">修改数据</button>
        用户名:<input type="text" v-model.trim="user.username"><br>
        密码:<input type="text" v-model.number="user.password"><br>
        性别:<input type="radio" value="male" name="gender" v-model="user.gender">男
        <input type="radio" value="male" name="gender" v-model="user.gender">女<br>
        爱好:<input v-model="user.hobby" type="checkbox" value="sing">唱歌
        <input v-model="user.hobby" type="checkbox" value="dance">跳舞
        <input v-model="user.hobby" type="checkbox" value="rap">rap<br>
        地址:<select v-model="user.adress">
            <option value="sichuan">四川</option>
            <option value="chongqing">重庆</option>
            <option value="guizhou">贵州</option>
        </select><br>
        介绍:<textarea cols="30" rows="10" v-model="user.description"></textarea>
        <button @click="submitHandler">提交</button><br>
        {{user}}
    </div>
    <script>
        var vm = new Vue({
            el:'#app',
            data:{
                user:{
                    hobby:[]
                }
            },
            methods:{
                submitHandler(){
                    let data=JSON.stringify(this.user);
                    console.log(data);
                }
            },
            created(){

            }
        })
    </script>
    
</body>
</html>